function [ hasil,hasil2 ] = y_RK33(f,f2,x0,y0,z0,b,h)
%Y_RK3 Summary of this function goes here
%   Menghitung y(b) dengan metode Runge-Kutta orde tiga pada PDB
%   y' = f(x,y); y(x0)=y0
    n = (b - x0)/h; %jumlah langkah
    y = y0;
    x = x0;
    z = z0;
    syms a b c;
    for r = 2 : n+1
        k1 = h * subs(f, [a b c], [x y z]);
        
        k2 = h * subs(f, [a b c], [(x + h / 2) (y + k1 / 2) z]);
        
        k3 = h * subs(f, [a b c], [(x + h) (y - k1 + 2 * k2) z]);
        
        y = y + (k1 + 4 * k2 + k3) / 6;
        k1 = h * subs(f2, [a b c], [x y z]);
        
        k2 = h * subs(f2, [a b c], [(x + h / 2) y (z + k1 / 2)]);
        
        k3 = h * subs(f2, [a b c], [(x + h) y (z - k1 + 2 * k2)]);
        
        z = z + (k1 + 4 * k2 + k3) / 6;
        x = x + h;
    end
    hasil = y;
    hasil2 = z;
end
